package org.itstack.demo.design.pay.channel;

import org.itstack.demo.design.pay.mode.IPayMode;

import java.math.BigDecimal;

/**
 * @Author: fanYuLe
 * @CreateTime: 2023-12-19  16:22
 * @Description:
 */
public class ZfbPay extends Pay{
    public ZfbPay (IPayMode payMode){super(payMode);}
    @Override
    public String transfer(String uId, String tradeId, BigDecimal amount) {
       logger.info("模拟支付宝渠道支付划账开始。uId：{} tradeId：{} amount：{}",uId,tradeId,amount);
        boolean security = payMode.security(uId);
        logger.info("模拟支付宝渠道支付风控校验。uId：{} tradeId：{} security：{}",uId,tradeId,security);
        if(!security){
            logger.info("模拟支付宝渠道支付划账拦截。uId：{} tradeId：{} amount：{}",uId,tradeId,amount);
            return "0001";
        }
        logger.info("模拟支付宝渠道支付划账成功。uId：{} trade：{} amount：{}",uId,tradeId,amount);
        return "0001";
    }
}
